﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>GTK</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	font-size: large;
}
</style>
</head>
<body>

<h2>GTK System Driver<span class="style1"> (since 3.0)</span></h2>
<p>This driver was designed for the GTK+ 
  version 2. It can be compiled in Windows or UNIX.</p>
<p>Although GTK has layout elements they are not used. IUP fill, vbox, hbox and 
zbox containers are implemented independent from the native system.</p>
<p>The oldest GTK version that can be used is 2.4, oldest versions will not 
compile. But using versions older than 2.12 several features will not work. 
Critical features need at least version 2.8.</p>
<p>Currently it is not available for IRIX, AIX and SunOS. But is it available 
for SunOS10 and it is not available for Linux24.</p>
<h3>Tips</h3>
<h4>Dependencies</h4>
<p>GTK is in fact composed of several libraries. The GTK package contains the 
GDK library and depends on the ATK, Cairo, Glib and Pango libraries.</p>
<h4>UTF-8</h4>
<p>GTK uses UTF-8 as its charset for all displayed text, so IUP will 
automatically convert all strings to (SetAttribute) and from (GetAttribute) 
UTF-8. To use UTF-8 strings set the global attribute UTF8AUTOCONVERT to NO.</p>

<h4>Windows</h4>

<p>The GTK driver can be compiled and used in Windows, but it is not recommended since it is slower and 
much more memory 
  consuming than the IUP native Windows driver.</p>
<p>When using DLLs in Windows, the &quot;iup.dll&quot; uses the Win32 driver. So 
applications that dynamically load IUP will always use the &quot;iup.dll&quot;, for 
example Lua using require. To use the IUP GTK dll in Windows you must rename the 
&quot;iupgtk.dll&quot; to &quot;iup.dll&quot;, so the GTK driver will be loaded instead of the Win32 
driver.</p>
<p>After installing the GTK binaries, we recommend to change the default theme 
to the &quot;MS-Windows&quot; theme. Edit the &quot;gtk\etc\gtk-2.0\gtkrc&quot; file and change its 
contents to:</p>
<pre>gtk-theme-name = &quot;MS-Windows&quot;</pre>
<h4>MacOSX-Quartz</h4>
<p>The GTK driver also compiles in MacOSX with the new GTK port available at
<a href="http://gtk-osx.sourceforge.net/">http://gtk-osx.sourceforge.net/</a> 
using Quartz. 
But the <strong>IupGLCanvas</strong> is not available yet. You must use the GDK base driver of 
the CD library. Some elements like <strong>IupTree</strong> are not 100% functional 
because of the gtk-osx implementation. The 
installation of gtk-osx is quite complex because there are no pre-compiled 
binaries. Also if the MacOSX theme is used, several controls have problems. We 
hope that this will improve in the future. Must define GTK_MAC before compiling to enable this build.</p>
<h4>MacOSX-X11</h4>
<p>So for now we are distributing binaries that use the X11 version of GTK 2.16. 
They were installed using <a href="http://www.finkproject.org/">Fink</a>. Here 
is a simple guide to install fink so the pre-compiled binaries will work (tested 
in 10.5 and 10.6):</p>
<pre>Download latest fink source: <a href="http://downloads.sourceforge.net/fink/fink-0.29.21.tar.gz">fink-0.29.21</a>
tar -xvzf fink-0.29.21.tar.gz 
cd fink-0.29.21
./bootstrap
	Use all default answers, except for the second question about 64bits:
	(10.5) =&gt; (1) Default (mostly 32bit)  [because gcc use 32bit as default]
	(10.6) =&gt; (2) 64bit-only              [because gcc use 64bit as default]
/sw/bin/pathsetup.sh
fink selfupdate-rsync
fink index -f
fink install gtk+2 gtk+2-dev</pre>
<p>It will take some time to download and install everything, so have patience.</p>
<p>After that you should get something like this:</p>
<pre>fink --version
  Package manager version: 0.29.10
  Distribution version: selfupdate-rsync Thu Apr 29 11:51:11 2010, 10.6, x86_64  (10.6)
  Distribution version: selfupdate-rsync Thu Apr 29 11:50:49 2010, 10.5, i386    (10.5)

fink list -i gtk+2
  Information about XXXX packages read in X seconds.
   i   gtk+2            2.16.6-3     The Gimp Toolkit
   i   gtk+2-dev        2.16.6-3     The Gimp Toolkit
   i   gtk+2-shlibs     2.16.6-3     The Gimp Toolkit
</pre>

<p>You can use <a href="http://www.macports.org/">MacPorts</a> instead of Fink. 
The installation is very similar, but it seems simpler. Although we did not have 
the opportunity to test it, some users report that this work ok.</p>
<p>MacPorts have two GTK installations, one for X11 and one for Quartz. This is 
a lot simpler than trying to install the gtk-osx distribution. Just keep in mind 
that if using Quartz, OpenGL with IUP will not be available.</p>
<p>When building IUP or CD in MacOSX, define the following variables in the 
system before typing &quot;make&quot;:</p>
<pre>export USE_MACOS_OPENGL=Yes      # To use the OpenGL framework
export GTK_BASE=/sw              # For Fink
export GTK_BASE=/opt/local       # For MacPorts
export GTK_MAC=Yes               # For Quartz instead of X11</pre>

</body>

</html>